package com.ethink.order.api.request;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import javax.validation.constraints.NotEmpty;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

/**
 * @author default
 * @version 1.0.0
 * @ClassName PurchaseQuoteRequest.java
 * @Description
 * @createTime 2022年11月02日 14:11:00
 */
@Data
public class PurchaseQuoteRequest {
    @Schema(hidden = true)
    private String createUserCode;

    @Schema(hidden = true)
    private String createUserName;


    @Schema(description = "销售需求单号")
    private String orderNo;

    @Schema(description = "销售需求详情单号")
    private String detailOrderNo;

    @NotEmpty
    @Schema(description = "数据")
    private List<PurchaseQuoteRequest.Item> item;
    @Data
    public static class Item {

        @Schema(description = "主键")
        private Long id;

        @Schema(description = "供应商code")
        private String supplierCode;

        @Schema(description = "供应商名称")
        private String supplierName;

        @Schema(description = "付款方式:1-100%预付(t1)|2-先贷后款(t2)|3-分期付款(t3)")
        private Integer payType;

        @Schema(description = "预供采购价")
        private BigDecimal purchasePrice;

        @Schema(description = "货币编码")
        private String currencyCode;

        @Schema(description = "货币名称")
        private String currencyName;

        @Schema(description = "价格有效期")
        @DateTimeFormat(pattern = "yyyy-MM-dd'T'HH:mm:ss")
        private Date priceValidityPeriod;

        @Schema(description = "可供数量")
        private Integer availableQty;

        @Schema(description = "商品有效期")
        @DateTimeFormat(pattern = "yyyy-MM-dd")
        @JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8")
        private Date validityPeriod;

        @Schema(description = "备注")
        private String remark;

        @Schema(description ="交货方式")
        private String deliveryWay;

        @Schema(description ="交货地点")
        private String deliveryPlace;

        @Schema(description ="供应商预计交货时间")
        @DateTimeFormat(pattern = "yyyy-MM-dd")
        @JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8")
        private Date expectSupplierTime;

        @Schema(hidden = true)
        private BigDecimal exchangeRate;

    }
}
